<template>
  <view class="outBox">
    <u-navbar leftText="我的订单" leftIconColor="#fff" :autoBack="true" bgColor="rgba(0, 0, 0, 0.6)">
      <view class="left-slot" slot="left">
        <u-icon name="arrow-left" color="#fff"></u-icon>
        <text>{{ '我的订单' }}</text>
      </view>
    </u-navbar>
    <view class="bgBox"></view>
    <video :src="videoUrl + '/mp4/1.mp4'" autoplay :controls="false" loop
           object-fit="cover"></video>
    <view class="content" :style="{
			marginTop:menuHeight + 'px',
		}">
      <view class="items">
        <view class="item" :style="{
					backgroundImage:`url(${baseImgUrl}mine/bg3.png)`,
				}">
          <view class="left">
            <view class="top">
              <view class="tag">
                <text>桌号</text>
              </view>
              <text class="name">{{ orderInfo.counterNo }}</text>
            </view>
            <view class="bottom">
              <text>下单时间：{{ orderInfo.createTime }}</text>
            </view>
          </view>
          <view class="right">
            <view class="price">
              <text>¥{{ orderInfo.consumePrice }}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="innerBox">
        <view class="topBox">
          <view class="left">
            <view class="tag">
              <text>桌号</text>
            </view>
            <view class="name">
              <text>{{ orderInfo.counterNo }}</text>
            </view>
          </view>
        </view>
        <view class="table">
          <view class="item">
            <view class="label">
              <text>酒水</text>
            </view>
            <view class="label">
              <text>数量</text>
            </view>
          </view>
          <view class="item" v-for="item in orderInfo.detailList">
            <view class="label">
              <text>{{ item.productName }}</text>
            </view>
            <view class="value">
              <text>x{{ item.orderNum }}</text>
            </view>
            <!--            <view class="val3">-->
            <!--              <text>¥{{ item.unitPrice }}</text>-->
            <!--            </view>-->
            <!--            <view class="val4">-->
            <!--              <text>¥{{ item.totalPrice }}</text>-->
            <!--            </view>-->
          </view>
        </view>
        <view class="table table2">
          <view class="item">
            <view class="label">
              <text>合计消费</text>
            </view>
            <view class="price">
              <text>¥</text>
              <text class="num">{{ orderInfo.consumePrice }}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="itemBox">
        <view class="tit">
          <text>订单信息</text>
        </view>
        <view class="text">
          <view class="textItem">
            <view class="name">
              <text>下单时间</text>
            </view>
            <view class="value value2">
              <text>{{orderInfo.createTime}}</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import {
  getWXStatusHeight
} from '@/utils/index.js'

import {
  findMyCounterOrderDetailApi
} from '../../api/api'

export default {
  data() {
    return {
      // 胶囊的宽度
      barWidth: 0,
      menuHeight: 0,
      dataList: [],
      videoUrl: this.$videoUrl,
      orderId: '', //订单id
      orderInfo: {},
      baseImgUrl: this.$baseImgUrl,
    }
  },
  onLoad(e) {
    let obj = getWXStatusHeight()
    this.barWidth = obj.barWidth + 3
    this.menuHeight = obj.menuHeight
    this.dataList = uni.getStorageSync("choiceDataList")
    this.orderId = e.id

    this.findMyCounterOrderDetail()
  },
  methods: {
    async findMyCounterOrderDetail() {
      const res = await findMyCounterOrderDetailApi(this.orderId)
      if (res.code == 200) {
        this.orderInfo = res.data
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.itemBox {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 60rpx;
  border: 2rpx solid #283433;
  backdrop-filter: blur(7px);
  padding: 42rpx;
  margin-top: 30rpx;

  .text {
    .textItem {
      margin-bottom: 15rpx;
      display: flex;
      justify-content: space-between;
      margin-top: 28rpx;

      &:last-child {
        margin-bottom: 0rpx;
      }

      .name {
        font-weight: 400;
        font-size: 28rpx;
        color: #86909C;
        line-height: 28rpx;
        text-align: left;
        font-style: normal;
      }

      .value {
        font-weight: 400;
        font-size: 28rpx;
        color: #FFFFFF;
        line-height: 28rpx;
        text-align: left;
        font-style: normal;

        .txt {
          font-weight: 400;
          font-size: 28rpx;
          color: #FFFFFF;
          line-height: 28rpx;
          text-align: left;
          font-style: normal;
        }
      }

      .value2 {
        text {
          font-weight: 400;
          font-size: 28rpx;
          color: #FFFFFF;
          line-height: 28rpx;
          text-align: left;
          font-style: normal;
        }
      }
    }
  }

  .borderItem {
    border: 1rpx solid #76a834;
    background-color: rgba(#76a834, .4);
    padding: 10rpx 20rpx;
    border-radius: 10rpx;
    display: flex;
    justify-content: space-between;

    text {
      font-size: 30rpx;
      color: #fff;
    }
  }

  .lastTime {
    color: #76a834;
  }

  .info {
    display: flex;
    font-size: 28rpx;
    margin-bottom: 10rpx;

    text {
      color: #f3f3f3;

      &:nth-child(1) {
        color: #76a834;
        margin-right: 20rpx;
      }
    }
  }

  .tit {
    padding-bottom: 26rpx;
    border-bottom: 2rpx solid #2d2f2d;

    text {
      font-weight: 500;
      font-size: 36rpx;
      color: #FFFFFF;
      line-height: 36rpx;
      text-align: left;
      font-style: normal;
    }
  }

  .tit2 {
    padding-bottom: 26rpx;
    border-bottom: 2rpx solid #2d2f2d;

    .textItem {
      margin-top: 0rpx;

    }
  }

}
.tag {
  width: 76rpx;
  height: 40rpx;
  background: #FF9A2E;
  border-radius: 14rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16rpx;

  text {
    font-weight: 400;
    font-size: 28rpx;
    color: #FFFFFF;
  }
}
.table{
  .item{
    .price {
      text{
        color: #fff;
        font-size: 28rpx;
      }
      .num{
        font-weight: 500;
        font-size: 36rpx;
        color: #FFFFFF;
        line-height: 36rpx;
        text-align: right;
        font-style: normal;
      }
    }
  }
}

.items {
  .item {
    display: flex;
    justify-content: space-between;
    padding: 40rpx;
    margin-bottom: 30rpx;
    box-sizing: border-box;
    background-size: 100% 100%;



    .right {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      .price {
        font-weight: 500;
        font-size: 36rpx;
        color: #FFFFFF;
        line-height: 36rpx;
        text-align: right;
        font-style: normal;
      }

      .top {
        margin-bottom: 34rpx;

        text {
          color: #E8EF89;
          font-size: 24rpx;
        }
      }

      .status {
        font-family: Microsoft YaHei, Microsoft YaHei;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 116rpx;
        height: 42rpx;
        background: #192A15;
        border-radius: 200rpx 200rpx 200rpx 200rpx;
        border: 2rpx solid #3ED060;

        text {
          font-weight: 400;
          font-size: 20rpx;
          color: #32F178;
        }
      }
    }

    .right2 {
      .top {
        text {
          font-weight: 500;
          font-size: 36rpx;
          color: #FFFFFF;
          line-height: 36rpx;
          text-align: right;
          font-style: normal;
        }
      }

      .status1 {
        border-color: #67E3FF;
        background: #153337;

        text {
          color: #67E3FF;
        }
      }

      .status2 {
        border-color: #414141;
        background: #282828;

        text {
          color: #414141;
        }
      }
    }

    .left {
      .top {
        display: flex;
        margin-bottom: 20rpx;

        .name {
          font-size: 32rpx;
          color: #FFFFFF;
        }

      }

      .bottom {
        font-size: 28rpx;
        color: #86909C;
        line-height: 28rpx;
        text-align: left;
        font-style: normal;

        .one {
          display: flex;
          align-items: center;
        }

        .tag {
          width: 76rpx;
          height: 40rpx;
          background: #0FC6C2;
          border-radius: 14rpx;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 16rpx;

          text {
            font-weight: 400;
            font-size: 28rpx;
            color: #FFFFFF;
          }
        }

        .tag2 {
          background: #FF9A2E;
        }
      }
    }
  }
}

.bgBox {
  width: 100vw;
  height: 100vh;
  position: fixed;
  z-index: 1;
  background: rgba(0, 0, 0, 0.6);
}

.info {
  margin-top: 10rpx;

  .item {
    height: 50rpx;
    display: flex;
    align-items: center;
    background: rgba(22, 24, 40, 0.8);
    padding: 0 60rpx 20rpx;

    text {
      color: #B3B4C3;
      font-size: 28rpx;
    }
  }
}

.title {
  display: flex;
  justify-content: space-between;
  padding: 0 60rpx;
  height: 100rpx;
  align-items: center;
  background: rgba(22, 24, 40, 0.8);

  text {
    font-size: 32rpx;
  }

  .tit {
    color: #fff;
  }

  .price {
    text {
      font-weight: bolder;
      color: #fff;
      margin-left: 10rpx;
    }
  }
}

.innerBox {
  padding: 40rpx;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 60rpx;
  border: 2rpx solid #263232;
  backdrop-filter: blur(7px);
}

.table {
  overflow: hidden;
  border-bottom: 2rpx solid #28283d;
  margin-top: 22rpx;

  .label {
    text {
      font-weight: 400;
      font-size: 28rpx;
      color: #86909C;
      line-height: 28rpx;
      text-align: left;
      font-style: normal;
    }
  }

  .value {
    text {
      font-weight: 400;
      font-size: 28rpx;
      color: #FFFFFF;
      line-height: 28rpx;
      text-align: right;
      font-style: normal;
    }
  }

  .item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32rpx;
  }
}

.table2{
  border-bottom: none;
  .label{
    text{
      font-size: 28rpx;
    }
  }
}
.topBox {
  display: flex;
  justify-content: space-between;
  border-bottom: 2rpx solid #434c48;
  padding-bottom: 24rpx;

  .left {
    display: flex;

    .name {
      color: #fff;
      font-size: 32rpx;
    }
  }

  .right {
    display: flex;

    text {
      color: #fff;
    }

    .num {
      color: #C131AC;
      margin: 0 5rpx;
    }
  }
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 确保视频填充整个容器，可能会裁剪视频 */
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 0;
}

.content {
  position: relative;
  z-index: 99;
  box-sizing: border-box;
  padding: 32rpx;
}

.left-slot {
  color: #fff;
  display: flex;
  align-items: center;

  image {
    width: 40rpx;
    margin-right: 30rpx;
  }
}

.outBox {
  background-color: #242331;
}
</style>
